package com.mzy.javaapi.Jdk8;

import org.testng.annotations.Test;

import java.util.Optional;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author mzy
 * @Date 2022/6/28 19:55
 * @Version 1.0
 */
public class IsPresent {

    @Test
    public void demo01(){
        String string = new String();
        Optional<String> string1 = Optional.of(string);
        if (string1.isPresent()){
            System.out.println("null");
        }

    }

}
